//
//  DDBaseViewController.h
//  DingDongZP
//
//  Created by Jyh on 16/3/13.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface DDBaseViewController : UIViewController



#pragma mark -
#pragma mark - Public Method

// 判断返回数据的有效性
- (BOOL)isValidateResponseData:(id)responseObject;

// 返回数据状态错误
- (void)responseUnValidate:(id)responseObject;

// 服务端进入failed block
- (void)requestFaild;

#pragma mark -
#pragma mark - ProgressHUD

- (void)showToast:(NSString *)text;

- (void)showToastOnCenter:(NSString *)text;

- (void)showToast:(NSString *)text duration:(NSTimeInterval)time position:(CGPoint)position;

/**
 *  显示提示文字HUD
 *
 *  @param text 提示文字
 */
- (void)showText:(NSString *)text;
- (void)showText:(NSString *)text onView:(UIView *)view;

/**
 *  显示成功的HUD
 */
- (void)showSuccess;
- (void)showSuccessWithText:(NSString *)successText;
/**
 *  显示错误的HUD
 */
- (void)showErrorWithText:(NSString *)errorText;
- (void)showErrorWithText:(NSString *)errorText onView:(UIView *)view;


/**
 *  显示加载的loading，没有文字的
 */
- (void)showLoading;
/**
 *  显示带有某个文本加载的loading
 *
 *  @param text 目标文本
 */
- (void)showLoadingWithText:(NSString *)text;

/**
 *  显示带有某个文本加载的loading
 *
 *  @param text 目标文本
 *  @param view 目标界面
 */
- (void)showLoadingWithText:(NSString *)text onView:(UIView *)view;

/**
 *  隐藏HUD框
 */
- (void)hideLoading;

/**
 *  添加返回按钮
 */
//- (void)setLeftBarButtonItemWithWhite;

/**
 *  添加导航条右侧按钮
 */
- (void)addRightButtonItemWithImage:(UIImage *)image action:(SEL)action;

/**
 *  添加导航条左侧按钮
 */
- (void)addLeftButtonItemWithImage:(UIImage *)image action:(SEL)action;

/**
 *  @brief 预设的导航按钮
 */
- (UIBarButtonItem *)confirmItem;
- (void)actionConfirm:(UIButton *)btn;

- (UIBarButtonItem *)cancelItem;
- (void)actionCancel:(UIButton *)btn;

@end
